#include "graphics.h"
#include <iostream>
#include <conio.h>
int main(int argc, const char** argv) {
	int x = 0, y = 0, vx =1, vy = 4;
	initgraph(799, 599, EX_SHOWCONSOLE);
	setorigin(399, 299);
	setaspectratio(1, -1);
	setbkcolor(RGB(164, 255, 202));
	cleardevice();
	setfillcolor(WHITE);
	solidcircle(x, y, 40);
	while (true) {
		if (x >= 398 - 40 || x <= -398 + 40) {
			vx = -vx;
		}
		if (y >= 298 - 40 || y <= -298 + 40) {
			vy = -vy;
		}
		x += vx, y += vy;
		Sleep(40);
		cleardevice();
		solidcircle(x, y, 40);
	}
	_getch();
	closegraph();
	return 0;
}